//
//  MyCollectionViewController.m
//  10-10
//
//  Created by 钟纪旺 on 16/11/23.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import "MyCollectionViewController.h"
#import "MyCell.h"
#import "ZWCollectionViewFlowLayout.h"
@interface MyCollectionViewController ()<ZWwaterFlowDelegate>

@end

@implementation MyCollectionViewController



- (void)viewDidLoad {
    [super viewDidLoad];
    ZWCollectionViewFlowLayout *layout = (ZWCollectionViewFlowLayout *)self.collectionView.collectionViewLayout;
    [layout init];
    layout.degelate = self;
}

//代理方法
-(CGFloat)ZWwaterFlow:(ZWCollectionViewFlowLayout *)waterFlow heightForWidth:(CGFloat)width atIndexPath:(NSIndexPath *)indexPach
{
    return 60 + indexPach.item;
}

-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{

    return 1;

}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return 36;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath

{
    static NSString *ID = @"myid";
    MyCell *cell =[collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
    cell.backgroundColor =[UIColor redColor];
    cell.Lebel.text = @"心";
    cell.Photo.image = [UIImage imageNamed:@"like"];
    return cell;
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
